<template>
  <h2 ref="h3">hello</h2>
  <div>{{obj}}</div>
  <button @click="btn">改名</button>
</template>

<script>
import { reactive } from 'vue'

export default {
  // 组件实例创建之前
setup(){
 const obj = reactive({
   name:'张潮华'
 })
 const btn = ()=>{
   obj.name = 'zz'
   console.log(obj);
 }
 return {obj,btn}
}
}
</script>

<style>
</style>